﻿#region 命名空间

using System;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;

#endregion

namespace WinnerCMS.WebUI.Templates.WinnerCMS6.Member
{
    public partial class Addmoney : WebFactory.ClientPublicPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Title = WebConfig.SiteName + " → 会员中心 → 交费确认";
            if (RightsCheck.IsLogined == false)
            {
                MsgBox.Message("登录超时，请重新登录。", "Login.aspx", this);
            }
            else
            {
                if (!IsPostBack)
                {
                    if (Request["Action"] == null)
                    {
                        this.lblPath.Text = "发送确认";
                    }
                }
            }
        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            var model = new Business();
            model.Flag = 0;
            model.CreateTime = DateTime.Parse(this.txtDateTime.Text);
            model.Customer = this.txtCustomer.Text;
            model.PayMoney = int.Parse(this.txtPayMoney.Text);

            model.Indent = int.Parse(this.txtIndent.Text); //订单号
            model.UserId = UserManage.Current.UserID;
            for (var i = 0; i < this.RBL_PayMent.Items.Count; i++)
            {
                if (this.RBL_PayMent.Items[i].Selected)
                {
                    model.Remark = "汇款方式：" + this.RBL_PayMent.Items[i].Text + "\r\n" + this.txtRemark.Text;
                    break;
                }
            }

            new BusinessManage().Add(model);
            MsgBox.Message("添加成功！", "Addmoney.aspx", this);
        }
    }
}